<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit"> 
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<title>河北省中医院预约挂号网站</title>
<link type="text/css" rel="stylesheet" href="${webPath}/css/main.css?v=4"/>
<link type="text/css" rel="stylesheet" href="${webPath}/css/common.css"/>
<link type="text/css" rel="stylesheet" href="${webPath}/jquery-ui-1.11.4/jquery-ui.min.css"/>
<script type="text/javascript" src="${webPath}/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="${webPath}/jquery-ui-1.11.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="${webPath}/js/common.js"></script>
<script type="text/javascript">
$(function(){
	#if($!{deptCode})
		getSchedule('$!{deptCode}',0);
	#end
	
	// 展开更多科室或者收起科室
	$("#moreOrLess").click(function(){
		var height = $("#deptList_DD").css("height");
		var h = parseInt(height);
		if(h < 100){
			$("#deptList_DD").css("height","auto");
			$(this).html("收起更多>");
		}else{
			$("#deptList_DD").css("height","60px");
			$(this).html("展开更多>");
		}
	});
	
	// 点击科室，获取当前点击科室的所有排班信息
	$("a[id^='deptName_A']").click(function(){
		$("a[id^='deptName_A']").removeClass("active");
		var code = $(this).attr("code");
		getSchedule(code,0);
	})
})

// 异步获取科室排班信息
function getSchedule(deptCode,week){
	$("#deptName_A_"+deptCode).addClass("active");
	var deptName = $("#deptName_A_"+deptCode).html();
	// 先隐藏医生显示部分
	$("#ksorder_djgh_doctor").hide();
	
	var iWeek = 0;
	if(week){
		var aNum = Number(week);
		if(!isNaN(aNum)){
			iWeek = aNum;
		}
	}
	
	if(iWeek < 0 ){
		iWeek = 0;
	}else if(iWeek > 3){
		iWeek = 3;
	}
	
	
	// 这里获取科室排班信息
	var now = getDateFormat(addDate(getDateFormat(new Date()),iWeek*7 + 1));
	$.post("$!{webPath}/search/schedule/asyncScheduleNDaysDapartment.htm",{departmentCode:deptCode,sDate:now,n:7},function(data){
		if(data.success){
			var result = data.result;

			var str = "<div class='ksorder_cen_l_l'>";
			if(iWeek > 0){
				str += "<a href='javascript:getSchedule(\""+deptCode+"\","+(iWeek-1)+");' class='ksorder_btn_left'></a>";
			}else{
				/// aaaa 
				str += "<a href='javascript:void(0);' class='ksorder_btn_left no_order_left'></a>";
			}
			str += "<ul><li>上午</li><li>下午</li></ul>";
			str += "</div>";
			str += "<div class='ksorder_cen_l_table'><div class='ksorder_cen_l_t_c' style='width: 659px;'><table border='0' cellpadding='0' cellspacing='0'>"
			var head = "<tr>"; // table标题
			var t1 = "<tr>";// 上午内容
			var t2 = "<tr>"; // 下午内容
			for(var i =0;i<7;++i){
				var comDate = addDate(now,i);
				var key = getDateFormat(comDate);
				var sw = 0;
				var xw = 0;
				if(result[key]){
					$.each(result[key],function(index,obj){
						if(obj["sessionName"]=="上午") {
							sw += getAvailableNum(obj["availableLeftNum"]);
						} else if(obj["sessionName"]=="下午" || obj["sessionName"]=="中午" || obj["sessionName"]=="晚上"){
							xw += getAvailableNum(obj["availableLeftNum"]);
						}			
					})
				}

				head += "<th scope='col'>"+getWeek(comDate)+"<p>"+key+"</p></th>";
				if(sw > 0){
					t1 += "<td class='ksorder_kyy ksorder_bgcol' onclick='getDoctorList(this,\""+deptCode+"\",\"上午\",\""+key+"\")'>预约<br>剩余:有</td>";
				}else{
					t1 += "<td>&nbsp;无</td>";
				}
				if(xw > 0){
					t2 += "<td class='ksorder_kyy ksorder_bgcol' onclick='getDoctorList(this,\""+deptCode+"\",\"下午\",\""+key+"\")'>预约<br>剩余:有</td>";
				}else{
					t2 += "<td>&nbsp;无</td>";
				}
			}
			
			head += "</tr>"; 
			t1 += "</tr>";
			t2 += "</tr>"; 
			
			
			str += head;
			str += t1;
			str += t2;
			
			str += "</table></div></div>";
			if(iWeek < 3){
				str += "<div class='ksorder_cen_l_r'><a href='javascript:getSchedule(\""+deptCode+"\","+(iWeek+1)+");' class='ksorder_btn_right'></a></div>";
			}else{
				/// aaaaaa 
				str += "<div class='ksorder_cen_l_r'><a href='javascript:void(0);' class='ksorder_btn_right no_order_right'></a></div>";
			}
			$("#ksorder_cen_l").html(str);
		}
	},"json");
	
	// 显示科室排班内容
	$("#ksorder_time_title_nothing").hide();
	$("#ksorder_time_title_have").show();
	$("#sechedu_table_title_info").html("科室排班表("+deptName+")");
	$("#ksorder_time_center_table").show();
	
}


// 获取点击事件中的医生列表并排班到页面中，同时控制点击td中的样式改变
function getDoctorList(tdObj,deptCode,timeSole,dateStr){
	$(".ksorder_kyy").addClass("ksorder_bgcol");
	$(tdObj).removeClass("ksorder_bgcol");
	$.post("$!{webPath}/search/schedule/asyncScheduleNDaysDapartment.htm",{departmentCode:deptCode,sDate:dateStr},function(data){
		if(data.success){
			var result = data.result;
			var doctorHtml = "";
			
			// 获取上午下午晚上标识码
			var ts ;
			if(timeSole=="上午"){
				ts = "S";
			} else if (timeSole=="下午") {
				ts = "X";
			} else if (timeSole=="晚上") {
                ts = "Y";
            } else if (timeSole=="中午") {
                ts = "M";
            }
			
			$.each(result[dateStr],function(index,obj){
				if(obj["sessionName"] == timeSole ){
					var aNum = Number(obj["availableLeftNum"]);
					var ableNumFlag = true;
					if(isNaN(aNum)){
						ableNumFlag = false;
					}
					
					doctorHtml += "<div class='ksorder_djgh_dr1 ksorder_djgh_dr1_bg'>";
					doctorHtml += "<dl class='ksorder_dr1_dl'>";
					doctorHtml += "<dt><img src='$!{webPath}/images/doctor-m.png'></dt>";
					doctorHtml += "<dd>"+obj["doctorName"]+"</dd>";
					doctorHtml += "<dd>"+obj["departmentName"]+"</dd>";
					doctorHtml += "<dd><h4>"+obj["doctorTitle"]+"</h4></dd>";
					console.info("ableNumFlag -> " + ableNumFlag + ", doctorName -> " + obj["doctorName"]);
					if(!ableNumFlag){
						doctorHtml += "<dd class='sd-dd'><span class='sd-title-span'>预约时段：</span>";
						
						$.each(obj["availableNumStr"].split(","),function(index,obj){
							var numArr = obj.split(";");
							if(numArr.length > 1 &&  parseInt(numArr[1]) > 0){
								doctorHtml += "<span class='sd-time-span'>"+numArr[0]+"</span>";
							}
						})
						
						doctorHtml += "</dd>";
					}else{
						doctorHtml += "<dd class='sd-dd'><span class='sd-title-span'>预约时段：</span>";
						
						doctorHtml += "<span class='sd-time-span'>"+obj["startTime"]+"-"+obj["endTime"]+"</span>";
						doctorHtml += "</dd>";
					}
					doctorHtml += "</dl>";
					doctorHtml += "<p class='ksorder_dr1_p'>";
					doctorHtml += "<span class='ksorder_dr1spa'>挂号费：<b>&yen;"+(obj["regFee"]==""?"0":obj["regFee"])+"</b></span>";
					doctorHtml += "<span class='ksorder_dr1spa'>诊查费：<b>&yen;"+(obj["checkupFee"]==""?"0":obj["checkupFee"])+"</b></span>";
					doctorHtml += "</p>";
					doctorHtml += "<p class='ksorder_dr1_p2'><a href='$!{webPath}/search/order/bookOrder.htm?deptCode="+obj["departmentCode"]+"&docCode="+obj["doctorCode"]+"&date="+obj["serviceDate"]+"&timeSole="+ts+"' class='ksorder_dr1_syhy'>预约挂号</a></p>";
					doctorHtml += "</div>";
				}
			});
			
			
			$("#ksorder_djgh_doctor").html(doctorHtml);
			$("#ksorder_djgh_doctor").show();
		}
	},"json");
}
</script>
</head>
<body>
<input type="hidden" id="rootWebPath" value="$!{webPath}" />
<div class="ui-widget" id="top_alert_div" style="display:none;">
	<div class="ui-state-highlight ui-corner-all" style="border-radius:0;padding:0.7em;">
		<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
		<strong>警告!</strong>&nbsp;&nbsp;&nbsp;&nbsp;<span id="top_alert_div_msg">警告信息</span></p>
	</div>
</div>
<!--
	<div id="dbnav">
		<div class="dbnav_context">
			<p class="dbnav_context_left"><img src="http://img.bjguahao.gov.cn/ws/1.0/hs/images/dbnav.png"><span>010-114/116114电话预约</span></p>
			<div class="top_help">
				<a href="${webPath}/search/patient/searchPatInfo.htm">患者信息查询</a>
				<a href="javascript:void(0);">帮助中心</a>
			</div>
		</div>
	</div>
-->
<div id="top">
	<div class="top_left">
		<a href="$!{webPath}/index.htm"><img src="$!{webPath}/images/logo.png">
			<h2 class="top_h2">河北省中医院预约挂号网站</h2>
		</a>
	</div>
	<div class="top_search">
		<div class="option" id="wn_h_div">
			<span id="wn_h">科室</span>
		</div>
		<div class="sbox">
			<input class="ac_input" onblur="javascript:if(this.value=='')this.value='请输入搜索内容';" onfocus="javascript:if(this.value=='请输入搜索内容')this.value='';" value="请输入搜索内容" maxlength="30" name="words" id="words" type="text">
		</div>
		<div class="sbtn">
			<input value="" style="letter-spacing: -1px;" id="top_search_btn" type="button">
		</div>
		<div id="sbArea_h" style="display:none;">
			<a target="_self" href="javascript:void(0);">
				<div class="dselObj" id="wv_h_1">科室</div>
			</a>
			<a target="_self" href="javascript:void(0);">
				<div class="dselObj" id="wv_h_2">医生</div>
			</a>
		</div>
	</div>
</div>
<div id="index_nav_border">
	<div id="index_nav">
		<ul class="index_nav_ul">
			<li><a href="$!{webPath}/search/department/findAllDepartment.htm">全部科室</a></li>
			<li class="index_nav_lic"><a href="${webPath}/search/schedule/department.htm">科室排班</a></li>
			<li><a href="$!{webPath}/search/doctor/deptDoctorList.htm">科室医生</a></li>
		</ul>
		<div class="index_nav_right">
			<a target="_blank" href="$!{webPath}/search/order/queryOrder.htm">预约记录查询</a>
		</div>
	</div>
</div>

<div id="yiyuanxz_dh">
	<div class="yiyuanxz_dh1">
		<dl class="yiyuanxz_dh1_dl">
			<dt>科室选择</dt>
			<dd id="deptList_DD">
				<ul style="overflow:hidden;">
					#foreach($dept in $allDepts)
						<li><a href="javascript:void(0)" id="deptName_A_$!{dept.departmentCode}" code="$!{dept.departmentCode}">${dept.departmentName}</a></li>
					#end
				</ul>
			</dd>
		</dl>
		<div class="more-con"><a id="moreOrLess" href="javascript:void(0);">展开更多></a></div>
	</div>
</div>
	
	
<div id="ksorder_time">
	<div class="ksorder_time_title" id="ksorder_time_title_nothing" style="display:block;">
    	<p class="ksorder_t_p" style="color: #ff7400; font-style: normal;  font-size: 12px; text-align:center; padding:30px 0;"><font >请选择科室以查看科室排班信息</font></p>
    </div>
	<div class="ksorder_time_title" id="ksorder_time_title_have" style="display:none;">
    	<p class="ksorder_t_p" id="sechedu_table_title_info">科室排班表</p>
    </div>
    <div class="ksorder_time_center" id="ksorder_time_center_table" style="display:none;">
    	<div class="ksorder_cen_l" id="ksorder_cen_l">
    		<!-- 
    		<div class="ksorder_cen_l_l">
            	<a href="javascript:void(0);" class="ksorder_btn_left"></a>
            	<ul>
                    <li>上午</li>
                    <li>下午</li>
                    <li>晚上</li>
                </ul>
            </div>
            <div class="ksorder_cen_l_table">
            	<div class="ksorder_cen_l_t_c" style="width: 659px;">
            	<table border="0" cellpadding="0" cellspacing="0">
                  <tbody>
                  <tr>
                  	<th scope="col">星期四<p>2016-03-10</p></th>
                    <th scope="col">星期五<p>2016-03-11</p></th>
                    <th scope="col">星期六<p>2016-03-12</p></th>
                    <th scope="col">星期日<p>2016-03-13</p></th>
                    <th scope="col">星期一<p>2016-03-14</p></th>
                    <th scope="col">星期二<p>2016-03-15</p></th>
                    <th scope="col">星期三<p>2016-03-16</p></th>
                    </tr>
                  <tr>
                  	<td class="ksorder_kyy ksorder_bgcol">
		                    预约<br>剩余:2<input type="hidden" name="col_0" value="0_1_2016-03-10">
	                    </td>
                    <td>
		                    &nbsp;<input type="hidden" name="col_1" value="1_1_2016-03-11">
	                    </td>
                    <td>
		                    &nbsp;<input type="hidden" name="col_2" value="2_1_2016-03-12">
	                    </td>
                    <td>
		                    &nbsp;<input type="hidden" name="col_3" value="3_1_2016-03-13">
	                    </td>
                    <td>
		                    &nbsp;<input type="hidden" name="col_4" value="4_1_2016-03-14">
	                    </td>
                    <td>
		                    &nbsp;<input type="hidden" name="col_5" value="5_1_2016-03-15">
	                    </td>
                    <td class="ksorder_kyy">
		                    预约<br>剩余:2<input type="hidden" name="col_6" value="6_1_2016-03-16">
	                    </td>
                    </tr>
                  <tr>
                    <td>&nbsp;<input type="hidden" name="col_0" value="0_2_2016-03-10">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_1" value="1_2_2016-03-11">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_2" value="2_2_2016-03-12">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_3" value="3_2_2016-03-13">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_4" value="4_2_2016-03-14">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_5" value="5_2_2016-03-15">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_6" value="6_2_2016-03-16">
	                    </td>
                    </tr>
                  <tr>
                    <td>&nbsp;<input type="hidden" name="col_0" value="0_4_2016-03-10">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_1" value="1_4_2016-03-11">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_2" value="2_4_2016-03-12">
	                    </td>
                    <td>
                    	&nbsp;<input type="hidden" name="col_3" value="3_4_2016-03-13">
	                </td>
                    <td>&nbsp;<input type="hidden" name="col_4" value="4_4_2016-03-14">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_5" value="5_4_2016-03-15">
	                    </td>
                    <td>&nbsp;<input type="hidden" name="col_6" value="6_4_2016-03-16">
	                    </td>
                    </tr>
                </tbody></table>
                </div>
            </div>
            <div class="ksorder_cen_l_r">
            	<a href="javascript:void(0);" class="ksorder_btn_right"></a>
            </div>
             -->
    	</div>
    	<div class="ksorder_cen_r">
            <div class="ksorder_cen_r_top">
                <h4>预约规则</h4>
                <ul>
                    <li><span>1.</span>请务必填写真实有效的手机号码，预约成功后我们将对本手机发送预约成功提示短信，且手机号码为取号及取消预约的唯一凭证。如果您未收到"预约成功短信"，请拨打0311-69095114联系。</li>
                    <li><span>2.</span>每天可预约次日号源的服务时间截止到18:00之前，具体时间以0311-69095114服务电话查询或网站公示为准。</li>
                    <li><span>3.</span>因不同疾病诊察时间不等，此预约时间仅为参考，请您提前半小时到医院收费处办卡取号就诊。</li>
                    <li><span>4.</span>目前预约挂号平台暂不支持网上缴费，也不额外收取预约费，仅收取与现场挂号相同的挂号诊查费。</li>
                </ul>
                <!-- 
		            <dl>
		            	<dt>特殊规则</dt>
		                <dd>无</dd>
		            </dl>
	             -->
            </div>
        </div>
    </div>
    <!-- 医生列表信息 -->
    <div id="ksorder_djgh_doctor" style="display:none;">
    	<!-- 
		<div class="ksorder_djgh_dr1 ksorder_djgh_dr1_bg">
			<dl class="ksorder_dr1_dl">
				<dt><img id="doctorPortrait" src="http://img.bjguahao.gov.cn/naja/doctor/doctor.jpg" onerror="this.src=&quot;http://img.bjguahao.gov.cn/naja/doctor/doctor.jpg;&quot;"></dt>
				<dd>
				<h4>副主任医师</h4>
				<p>
					擅长治疗颅脑外伤、急慢性硬膜外、下出血、高血压脑出血。
				</p>
				</dd>
			</dl>
			<p class="ksorder_dr1_p">
				<span class="ksorder_dr1spa">挂号费：<b>￥6</b></span><span class="ksorder_dr1spa2">剩余号：<b>2</b></span>
			</p>
			<p class="ksorder_dr1_p2">
				<a href="/order/confirm/7-200000049-200000179-33324824.htm" class="ksorder_dr1_syhy">预约挂号</a>
			</p>
		</div>
		 -->
	</div>
</div>	
	
	
	<div class="footer-box clear path">
	<div class="footer-img-box">
		<div class="footer-img-left">
			<img src="${webPath}/images/logo.png" style="width:60px; height:auto; float:left">
			<ul style="padding-top:20px;float:left; padding-left:20px;">
				<li><span class="phone">0311-69095114</span></li>
				<li><span class="mail">时间：8:00-18:00</span></li>
				
			</ul>
		</div>
		<ul class="footer-img-right">
			<li class="image-hospital">
			<p>
				友情连接：
			</p>
			<ul>
				<li>
					<a title="网站名称：中健网网站地址：http://www.59120.com网站简介：综合健康网。" target="_blank" href="http://www.59120.com">中健网</a>
				</li>
				<li>
					<a title="网站名称：花讯网网站地址：http://www.flowercn.net网站简介：花卉资讯第一站。" target="_blank" href="http://www.flowercn.net">花讯网</a>
				</li>
				
				<li>
					<a title="网站名称：卫生部
网站地址：http://www.moh.gov.cn/
网站简介：卫生部" target="_blank" href="http://www.moh.gov.cn/">卫生部</a>
				</li>
				<li>
					<a title="网站名称：中医药管理局
网站地址：http://www.satcm.gov.cn/
网站简介：中医药管理局" target="_blank" href="http://www.satcm.gov.cn/">中医药管理局</a>
				<li>
					<a title="网站名称：胸科医院
网站地址：http://www.hbsxkyy.com/
网站简介：" target="_blank" href="http://www.hbsxkyy.com/">胸科医院</a>
				</li>
				<li>
					<a title="网站名称：河北医科大学
网站地址：http://www.hebmu.edu.cn/
网站简介：河北医科大学" target="_blank" href="http://www.hebmu.edu.cn/">河北医科大学</a>
				</li>
				<li>
					<a title="网站名称：河北医大二院
网站地址：http://www.hb2h.he.cninfo.net/
网站简介：河北医科大学第二医院" target="_blank" href="http://www.hb2h.he.cninfo.net/">河北医大二院</a>
				</li>
				<li>
					<a title="网站名称：河北医大三院
网站地址：http://www.cthhmu.com/main/index.aspx
网站简介：河北医科大学第三医院" target="_blank" href="http://www.cthhmu.com/main/index.aspx">河北医大三院</a>
				</li>
				<li>
					<a title="网站名称：河北医大四院
网站地址：http://www.hbydsy.com/
网站简介：河北医科大学第四医院" target="_blank" href="http://www.hbydsy.com/">河北医大四院</a>
				</li>
				<li>
					<a title="网站名称：河北省口腔医院
网站地址：http://www.hebmu.edu.cn/kqyx-1.htm
网站简介：河北医科大学口腔医院" target="_blank" href="http://www.hebmu.edu.cn/kqyx-1.htm">河北省口腔医院</a>
				</li>
				<li>
					<a title="网站名称：河北医大一院
网站地址：http://www.jyyy.com.cn/
网站简介：河北医科大学第一医院" target="_blank" href="http://www.jyyy.com.cn/">河北医大一院</a>
				</li>
				<li>
					<a title="网站名称：河北省卫生厅
网站地址：http://www.hebwst.gov.cn/
网站简介：河北省卫生厅" target="_blank" href="http://www.hebwst.gov.cn/">河北省卫生厅</a>
				</li>
				<li>
					<a title="网站名称：河北省药监局
网站地址：http://www.hebfda.gov.cn/
网站简介：河北省食品药品监督管理局" target="_blank" href="http://www.hebfda.gov.cn/">河北省药监局</a>
				</li>
				<li>
					<a title="网站名称：河北中医学院
网站地址：http://www.hbcmc.edu.cn/
网站简介：河北中医学院" target="_blank" href="http://www.hbcmc.edu.cn/">河北中医学院</a>
			</ul>
			</li>
			
		</ul>
	</div>
	
</div>
</body>
</html>